const axios = require("axios");

const getLovedMsg = () => {
  return new Promise((resolve, reject) => {
    axios
      .get(
        "http://api.tianapi.com/saylove/index?key=bde96d968457831a93e5fef175ca9d19"
      )
      .then((res) => {
        const { newslist } = res.data;
        resolve(newslist[0].content);
      })
      .catch((err) => {
        reject(err);
      });
  });
};

module.exports = getLovedMsg;
